Function Get-ConfigXml
{
    [CmdletBinding()]
    Param(
        [Parameter(Mandatory = $True)]
        [String]
        $private:ConfigName,

        [Parameter(Mandatory = $True)]
        [ScriptBlock]
        $private:GenerateDefaultConfigScriptBlock
    )
    
    Process
    {
        $private:ConfigPath = Get-ProfilePath | Join-Path -ChildPath ("{0}.xml" -f $ConfigName)
    
        If (-Not (Test-Path $ConfigPath))
        {
            $private:ConfigXml = Invoke-Command $GenerateDefaultConfigScriptBlock
            $ConfigXml.Save($ConfigPath)
        }
        Else
        {
            $private:ConfigXml = [xml](Get-Content $ConfigPath)
        }

        Return $ConfigXml
    }
}

Export-ModuleMember Get-ConfigXml
